package com.haoshuang.zhouzhoubang.ui.page.settled.pay.success

import android.content.Context
import android.os.Bundle
import com.haoshuang.zhouzhoubang.R
import com.haoshuang.zhouzhoubang.databinding.ActivityAnnualFeePaySuccessBinding
import com.haoshuang.zhouzhoubang.ui.page.main.MainActivity
import com.mufeng.libs.base.BaseVMActivity
import com.mufeng.libs.utils.SpannableStringUtils
import com.mufeng.libs.utils.startPage
import com.mufeng.libs.utils.toast
import com.mufeng.libs.utils.view.click


/**
 *  年费支付成功
 */
class AnnualFeePaySuccessActivity :
    BaseVMActivity<AnnualFeePaySuccessViewModel, ActivityAnnualFeePaySuccessBinding>() {

    companion object {
        fun launch(context: Context) {
            context.startPage<AnnualFeePaySuccessActivity>()
        }
    }

    override fun initView(savedInstanceState: Bundle?) {

        binding.titleBar.title = "支付成功"
        binding.titleBar.leftImageView().click { finish() }

        val str = "您已入驻成功，\n" +
                "您可去首页进行设置进行接单。"
        val span = SpannableStringUtils(mActivity, str).first("首页进行设置").textColor(R.color.c_ff0000)
        binding.tvTip.text = span

        binding.tvFinish.click {
            startPage<MainActivity>()
            finish()
        }

    }

    override fun initData() {

    }

    override fun startObserve() {

    }

}